//
//  PKPayBar.swift
//  Panku
//
//  Created by mac on 2017/5/28.
//  Copyright © 2017年 Monster. All rights reserved.
//

import UIKit

class PKPayBar: PKBaseView {
    
    //MARK: - UI
    lazy var cartButton = PKBaseButton.createButton()
    lazy var addToCartButton = PKBaseButton.createButton()
    lazy var payNowButton = PKBaseButton.createButton()
    
    override func setupView() {
        self.addSubview(cartButton)
        self.addSubview(addToCartButton)
        self.addSubview(payNowButton)

        self.backgroundColor = UIColor.white
        
        cartButton.setImage(R.image.pay_addToCart(), for: .normal)
        cartButton.addBlock(for: .touchUpInside) { (_) in
            //查看购物车
        }
        
        addToCartButton.setImage(R.image.pay_addToCart(), for: .normal)
        addToCartButton.addBlock(for: .touchUpInside) { (_) in
            //加入购物车
        }
        
        payNowButton.setImage(R.image.pay_now(), for: .normal)
        payNowButton.addBlock(for: .touchUpInside) { (_) in
            //立即购买
        }
        
        cartButton.snp.makeConstraints { (make) in
            make.centerY.equalTo(self.snp.centerY)
            make.left.equalTo(self.snp.left).offset(7)
        }
        
        addToCartButton.snp.makeConstraints { (make) in
            make.centerY.equalTo(self.snp.centerY)
            make.right.equalTo(payNowButton.snp.left).offset(12)
        }
        
        payNowButton.snp.makeConstraints { (make) in
            make.centerY.equalTo(self.snp.centerY)
            make.right.equalTo(self.snp.right).offset(12)
        }
        
    }

}
